package com.varbal.icegame.bean;

import com.varbal.icegame.action.AnimalAction;
import com.varbal.icegame.action.NallAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Cat extends Animal implements AnimalAction, NallAction {
	/**
	 * 
	 */
	private String catType;

	Logger logger = LoggerFactory.getLogger(getClass());
	
	public Cat() {
		super("cat");
	}

	public String getCatType() {
		return catType;
	}

	public void setCatType(String catType) {
		this.catType = catType;
	}


	@Override
	public boolean orEat(String food) {
		if (food.equals("猫粮")) {
			return true;
		}
		return false;
	}

	@Override
	public void run() {
		logger.info(this.getTypeName() + "跑过来了");
//		System.out.println(this.getTypeName() + "跑过来了");
	}

	@Override
	public void say() {
		logger.info(this.getTypeName() + "喵喵叫");
//		System.out.println(this.getTypeName() + "喵喵叫");
	}
	
	@Override
	public void eat() {
		logger.info(this.getTypeName() + "正在吃");
//		System.out.println(this.getTypeName() + "正在吃");
	}
	
	@Override
	public void seeFood(String food) {
		if (this.orEat(food)) {
			this.setOrHungry(true);
			logger.info(this.getTypeName() + "看到" + food + this.orHungry());
//			System.out.println(this.getTypeName() + "看到" + food + this.orHungry());
			this.eat();
			return;
		}
		System.out.println(this.getTypeName() + this.orHungry());
		this.setOrHungry(false);
	}
	
	@Override
	public String orHungry() {
		if(this.getOrHungry()) {
			return("饿了");
		}
		return "不饿";
	}
	
	
}
